<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:composition template="/template/DefaultTemplate.xhtml">
        <ui:define name="content">


            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form id="userView">
                <p:panel header="Pending Purchase Order:" style="text-align: center">
                    <p:dataTable  value="#{rawMaterialPurchaseOrderEditController.rpos}" var="rmq" widgetVar="userTable"
                                  paginator="true" rows="10"  
                                  paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
                                  selection="#{rawMaterialPurchaseOrderEditController.selectedPurchaseOrder}" selectionMode="single"
                                  rowSelectListener="#{rawMaterialPurchaseOrderEditController.purchaseOrderSelect}">     


                        <p:column sortBy="#{rmq.rmq.vendor.companyName}" filterBy="#{rmq.rmq.vendor.companyName}">    <f:facet name="header">  
                                <h:outputText value="Order from:" /> </f:facet>
                            <h:outputText value="#{rmq.rmq.vendor.companyName}" /> </p:column>
                        <p:column sortBy="#{rmq.rmq.rawMaterial.productName}" filterBy="#{rmq.rmq.rawMaterial.productName}">    <f:facet name="header">  
                                <h:outputText value="Raw material :" /> </f:facet>
                            <h:outputText value="#{rmq.rmq.rawMaterial.productName}" /> </p:column>    
                        <p:column sortBy="#{rmq.quantity}" filterBy="#{rmq.quantity}">    <f:facet name="header">  
                                <h:outputText value="Total Amount :" /> </f:facet>
                            <h:outputText value="#{rmq.quantity}" /> </p:column>
                        <p:column sortBy="#{rmq.cost}" filterBy="#{rmq.cost}">    <f:facet name="header">  
                                <h:outputText value="Total Cost :" /> </f:facet>
                            <h:outputText value="#{rmq.cost}" /> </p:column>
                             <p:column >    <f:facet name="header">  
                                <h:outputText value="Status :" /> </f:facet>
                            <h:outputText value="Reviewed" rendered ="#{rmq.updated}" /> 
                              <h:outputText value="Pending to Confirm Order Info" rendered ="#{!rmq.updated}" /></p:column>
                    </p:dataTable> 
                </p:panel>
                <br/>

            </h:form>

        </ui:define>
    </ui:composition>

</html>